package top.xuziyi.crawler.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import top.xuziyi.common.pojo.CodeDate;
import top.xuziyi.common.pojo.StockDayNormal;

import java.util.Date;

public interface StockDayNormalDao extends JpaRepository<StockDayNormal, CodeDate>,
        JpaSpecificationExecutor<StockDayNormal> {

    //根据指数代码和日期查询数据
    @Query(value = "select count(1) from stock_day_normal where symbol = ? AND `date` = ?", nativeQuery = true)
    public int findBySymbolAndDate(String symbol, Date date);
}
